package com.easywan.web.actions;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.easywan.core.BaseController;
import com.easywan.pojo.IResult;
import com.easywan.pojo.IResultSupport;
import com.easywan.service.IBaseManagerUserService;

@Controller
@RequestMapping("users/managerUser")
public class ManagerUsersController extends BaseController{
	@Autowired
	private IBaseManagerUserService managerUserService;
	@RequestMapping("increaseManagerUser")
	public String increaseManagerUser(HttpServletRequest request){
		try{
			String name = getString(request,"name");
			String email = getString(request,"email");
			String pwd = getPwd(request,"pwd");
			String mobile = getMobile(request);
			IResult result = managerUserService.add(name,email,pwd,mobile,1);
			return toJSON(result);
		}catch(Exception e){
			return toJSON(IResultSupport.buildResult(IResult.FAILT_CODE,e.getMessage()));
		}
	}
	
}
